﻿#region Includes

using System;
using System.Windows;
using ManagerWpf.Properties;

#endregion

namespace ManagerWpf
{
	/// <summary>
	/// Interaction logic for App.xaml
	/// </summary>
	public partial class App : Application
	{
		/// <summary>
		/// Occurs when the application starts.
		/// </summary>
		protected override void OnStartup(StartupEventArgs e)
		{
			Settings appSettings = Settings.Default;

			if (!string.IsNullOrEmpty(appSettings.Skin))
			{
				try
				{
					ResourceDictionary rd = new ResourceDictionary();
					rd.MergedDictionaries.Add(LoadComponent(new Uri(appSettings.Skin, UriKind.Relative)) as ResourceDictionary);
					Current.Resources = rd;
				}
				catch
				{
				}
			}

			base.OnStartup(e);
		}
	}
}